In Solid State Drives (SSDs), Garbage Collection (GC) is used for memory management by reclaiming memory that is no longer used. The memory so reclaimed returns to the free memory pool (pages) to be used for future write operations. Data is written in an SSD in terms of pages and erased in terms of memory blocks. Moreover, existing-data cannot be read and written back at the same place. Therefore, in order to claim a stale page in an SSD, the whole memory block that includes the stale page needs to be erased.
In conventional systems, a garbage collector component in the SSD selects that memory block for deletion which has the lowest number of valid pages. The garbage collector component then copies valid pages of this memory block to a free memory blocks and deletes that memory block. However, initiation of the garbage collection operation is performed only in response to a write operation on the SSD and when a controller in the SSD determines that only a threshold number of free memory blocks are left in the SSD. The threshold number may also be a single free memory block. As a result of this, writing operation on the SSD gets delayed and the user experience gets impacted. Moreover, frequent initiation of garbage collection operation overloads the system by consuming more CPU cycles. The reason being that for each garbage collection operation the main memory gets involved in the process of copying valid pages to a free memory block.